struct Solution {}

fn main() {}

impl Solution {
    pub fn is_power_of_four(n: i32) -> bool {
        if n <= 0 {
            return false;
        }

        let mut n1 = n;
        while n1 > 1 {
            if n1 % 4 != 0 {
                return false;
            }
            n1 /= 4;
        }
        true
    }
}